package book;

public class Book {
    private String name;
    private String author;
    private String price;
    private String type;
    private boolean flag;

    public Book(String name, String author, String price, String type) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;

    }

    public String getName() {
        return name;
    }


    public void setName(String name) {
        this.name = name;
    }

    public String getAuthor() {
        return author;
    }

    public void setAuthor(String author) {
        this.author = author;
    }

    public String getPrice() {
        return price;
    }

    public void setPrice(String price) {
        this.price = price;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public boolean isFlag() {
        return flag;
    }

    public void setFlag(boolean flag) {
        this.flag = flag;
    }
    public boolean getFlag(){
        return flag;
    }
    @Override
    public String toString() {
        String f = "";
        if(flag == true){
            f = "已借出";
        }
        else{
             f = "未借出";
        }
        return "Book{" +
                "书名='" + name + '\'' +
                ", 作者='" + author + '\'' +
                ", 价格='" + price + '\'' +
                ", 类型='" + type + '\'' +
                ", 状态=" + f +
                '}';
    }
}
